from appium import webdriver
class Base():
    def c(self):
            cap={
                  "platformName": "Android",
                  "appium:deviceName": "emulator-5554",
                  "appium:automationName": "uiautomator2",
                  "appium:appPackage": "com.xiachufang",
                  "appium:appActivity": ".activity.home.HomeActivity",
                  "appium:noReset": True
                }
            self.driver=webdriver.Remote('http://127.0.0.1:4723/wd/hub',cap)
            self.driver.implicitly_wait(10)
    def find_ele(self,loc):
        ele=self.driver.find_element(*loc)
        return ele
    def huadong(self,x,y,z,w):
        self.driver.swipe(x,y,z,w,100)
    def qing(self,a,b):
        self.driver.tap([(a,b)],10)
    def tuichu(self):
        self.driver.quit()
    def jietu(self,a):
        self.driver.save_screenshot(a)

